package com.nbjtjc.safe.model.danger;

import com.nbjtjc.common.validator.group.DeleteGroup;
import com.nbjtjc.common.validator.group.UpdateGroup;
import com.nbjtjc.safe.bean.Page;
import com.nbjtjc.safe.model.safe.SafeBasis;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Table(name = "danger_inspect_list")
public class DangerInspectList extends Page {
    /**
     * 检查项目
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @NotNull(message = "更新时主键不能为空",groups = {UpdateGroup.class})
    private Integer id;

    /**
     * 检查项目
     */
    @Column(name = "inspect_project")
    private String inspectProject;

    /**
     * 检查内容
     */
    @Column(name = "inspect_content")
//    @NotNull(message = "检查标准内容")
    private String inspectContent;

    /**
     * 排序的序号
     */
    private Integer num;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 创建人员的id
     */
    @Column(name = "create_user_id")
    private Integer createUserId;

    /**
     * 更新人员的id
     */
    @Column(name = "update_user_id")
    private Integer updateUserId;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 关联的检查表的名字
     */
    @Column(name = "inspect_id")
//    @NotNull(message = "添加或者更新时，关联的inspectId不能为空")
    private Integer inspectId;

    private Integer companyId;

    /**
     * 修改意见
     */
    private String suggestion;

    /**
     * 对应的检查依据id
     */
    @Column(name = "basis_id")
    private Integer basisId;

    @Column(name = "inspect_project_order")
    private Integer inspectProjectOrder;
    @Transient
    @NotEmpty(message = "更新时主键不能为空",groups = {DeleteGroup.class})
    private List<Integer> ids=new ArrayList<>();

    @Transient
    private Integer rowspan=0;
    @Transient
    private boolean needRowspan=false;

    @Transient
    private boolean needBasis=false;

    @Transient
    private SafeBasis safeBasis;
    @Transient
    private List<Integer> inspectIds=new ArrayList<>();


    public SafeBasis getSafeBasis() {
        return safeBasis;
    }

    public void setSafeBasis(SafeBasis safeBasis) {
        this.safeBasis = safeBasis;
    }

    public boolean getNeedBasis() {
        return needBasis;
    }

    public void setNeedBasis(boolean needBasis) {
        this.needBasis = needBasis;
    }

    public boolean isNeedRowspan() {
        return needRowspan;
    }

    public Integer getRowspan() {
        return rowspan;
    }

    public void setRowspan(Integer rowspan) {
        this.rowspan = rowspan;
    }

    public boolean getNeedRowspan() {
        return needRowspan;
    }

    public void setNeedRowspan(boolean needRowspan) {
        this.needRowspan = needRowspan;
    }

    public String getSuggestion() {
        return suggestion;
    }

    public void setSuggestion(String suggestion) {
        this.suggestion = suggestion;
    }

    public Integer getBasisId() {
        return basisId;
    }

    public void setBasisId(Integer basisId) {
        this.basisId = basisId;
    }

    public Integer getInspectProjectOrder() {
        return inspectProjectOrder;
    }

    public void setInspectProjectOrder(Integer inspectProjectOrder) {
        this.inspectProjectOrder = inspectProjectOrder;
    }

    public List<Integer> getInspectIds() {
        return inspectIds;
    }

    public void setInspectIds(List<Integer> inspectIds) {
        this.inspectIds = inspectIds;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public List<Integer> getIds() {
        return ids;
    }

    public void setIds(List<Integer> ids) {
        this.ids = ids;
    }


    /**
     * 获取检查项目
     *
     * @return id - 检查项目
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置检查项目
     *
     * @param id 检查项目
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取检查项目
     *
     * @return inspect_project - 检查项目
     */
    public String getInspectProject() {
        return inspectProject;
    }

    /**
     * 设置检查项目
     *
     * @param inspectProject 检查项目
     */
    public void setInspectProject(String inspectProject) {
        this.inspectProject = inspectProject;
    }

    /**
     * 获取检查内容
     *
     * @return inspect_content - 检查内容
     */
    public String getInspectContent() {
        return inspectContent;
    }

    /**
     * 设置检查内容
     *
     * @param inspectContent 检查内容
     */
    public void setInspectContent(String inspectContent) {
        this.inspectContent = inspectContent;
    }

    /**
     * 获取排序的序号
     *
     * @return num - 排序的序号
     */
    public Integer getNum() {
        return num;
    }

    /**
     * 设置排序的序号
     *
     * @param num 排序的序号
     */
    public void setNum(Integer num) {
        this.num = num;
    }

    /**
     * 获取创建时间
     *
     * @return create_time - 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置创建时间
     *
     * @param createTime 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取创建人员的id
     *
     * @return create_user_id - 创建人员的id
     */
    public Integer getCreateUserId() {
        return createUserId;
    }

    /**
     * 设置创建人员的id
     *
     * @param createUserId 创建人员的id
     */
    public void setCreateUserId(Integer createUserId) {
        this.createUserId = createUserId;
    }

    /**
     * 获取更新人员的id
     *
     * @return update_user_id - 更新人员的id
     */
    public Integer getUpdateUserId() {
        return updateUserId;
    }

    /**
     * 设置更新人员的id
     *
     * @param updateUserId 更新人员的id
     */
    public void setUpdateUserId(Integer updateUserId) {
        this.updateUserId = updateUserId;
    }

    /**
     * 获取更新时间
     *
     * @return update_time - 更新时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置更新时间
     *
     * @param updateTime 更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 获取关联的检查表的名字
     *
     * @return inspect_id - 关联的检查表的名字
     */
    public Integer getInspectId() {
        return inspectId;
    }

    /**
     * 设置关联的检查表的名字
     *
     * @param inspectId 关联的检查表的名字
     */
    public void setInspectId(Integer inspectId) {
        this.inspectId = inspectId;
    }

    @Override
    public String toString() {
        return "DangerInspectList{" +
                ", inspectProjectOrder=" + inspectProjectOrder +
                ", inspectProject='" + inspectProject + '\'' +
                ", num=" + num +
                ", inspectContent='" + inspectContent + '\'' +

                '}';
    }
}